<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <div th:include="common/css::css"></div>
</head>
<body>
<script>
    function validate(){
        var grade=document.getElementById("grade").value;
        var point=document.getElementById("point").value;
        if(grade===""||point===""){
            if(grade===""){
                alert("成绩不能为空")
            }
            if(point===""){
                alert("绩点不能为空")
            }
            return false;
        }else {
            return true;
        }
    }
</script>
<!-- loader Start -->
<div id="loading" style="display: none;">
    <div id="loading-center">
    </div>
</div>
<!-- loader END -->
<!-- Wrapper Start -->
<div class="wrapper">
    <div th:include="common/top :: top"></div>
    <div th:include="common/left :: left(activeUrl='course',Url='grade/list')"></div>
    <div id="content-page" class="content-page">
        <div class="container-fluid">
            <div class="row">
                <div class="col-lg-12">
                    <div class="iq-card">
                        <div class="iq-card-header d-flex justify-content-between">
                            <div class="iq-header-title">
                                <h4 class="card-title">编辑成绩信息</h4>
                            </div>
                        </div>
                        <div class="iq-card-body">
                            <p>请修改成绩信息</p>
                            <form th:action="@{/grade/editor}" method="post">
                                <div class="form-group">
                                    <label for="name">学号:</label>
                                    <p style="font-weight: bolder" id="name"  th:text="${grade.stuNumber}"></p>
                                </div>
                                <div class="form-group">
                                    <label for="cuoNumber">课程号:</label>
                                    <p style="font-weight: bolder" id="cuoNumber"  th:text="${grade.couId}"></p>
                                </div>
                                <div class="form-group">
                                    <label for="grade">成绩:</label>
                                    <input type="text" class="form-control" id="grade" name="grade" th:value="${grade.grade}">
                                </div>
                                <div class="form-group">
                                    <label for="point">绩点:</label>
                                    <input type="text" class="form-control" id="point" name="point" th:value="${grade.point}">
                                </div>
                                <input type="hidden" name="stuNumber" th:value="${grade.stuNumber}">
                                <input type="hidden" name="couId" th:value="${grade.couId}">
                                <button type="submit" class="btn btn-primary mr-2" onclick="return validate()">提交</button>
                                <button type="reset" class="btn iq-bg-danger">重置</button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="common/js::js"></div>
</body>
</html>